import request from '@/utils/request';


/**
 * 获取邮箱验证码
 * @param title
 * @param email
 */
export function getMailCode(query: { title: string, email: string }) {
    return request({
        url: '/business/mail/getCode',
        method: 'get',
        params: query
    });
}

/**
 * 邮箱验证码登录
 * @param data
 */
export function mailLogin(data: { title: string, email: string, code: string }) {
    return request({
        url: '/mailLogin',
        method: 'post',
        data
    });
}


/**
 * 邮箱注册
 * @param data
 */
export function mailRegister(data: { title: string, email: string, code: string, password: string }) {
    return request({
        url: '/mailRegister',
        method: 'post',
        data
    });
}

/**
 * 绑定邮箱
 * @param data
 */
export function bindMail(data: { title: string, email: string, code: string }) {
    return request({
        url: '/business/myCenter/bindMail',
        method: 'put',
        data
    });
}


